﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ListenMusic.Category_ServiceReferences;
using System.ServiceModel;
namespace ListenMusic.Models.Public
{
    public class CategoryRepository
    {
        CategoryServiceClient cate_client = new CategoryServiceClient("WSHttpBinding_ICategoryService2");
        public List<Category> getAllCategory()
        {
            try
            {
                Category[] cate = cate_client.getAllCategory();
                return cate.ToList();
            }
            catch (FaultException ex)
            {
                throw ex;
            }
        }
        public List<DataContract_Category> getAllCategory_byCountry(int countryid)
        {
            try
            {
                DataContract_Category[] cate = cate_client.getAllCategory_byContry(countryid);
                return cate.ToList();
            }
            catch (FaultException ex)
            {
                throw ex;
            }
        }
    }
}